home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_02
/
8n02023a
< prev
next >
Wrap
Text File
|
1990-02-28
|
4KB
|
176 lines
LISTING 2
module editor
version = 'v1.0'
names = case_sensitive
include file('XmAppl.uil');
procedure GPcallback(string);
new_buffer();
load_file();
save_file();
saveas_file();
exit_editor();
create_text_widget();
object editor_main : XmMainWindow {
controls {
XmMenuBar menu;
XmFrame workframe;
};
};
object menu : XmMenuBar {
arguments {
XmNmenuHelpWidget = XmCascadeButton helpmenu;
};
controls {
XmCascadeButton filemenu;
XmCascadeButton optionmenu;
XmCascadeButton helpmenu;
};
};
object filemenu : XmCascadeButton {
arguments {
XmNlabelString = 'File';
XmNmnemonic = 70; ! (this is ASCII for 'F')
};
controls {
XmPulldownMenu file_pulldown;
};
};
object file_pulldown : XmPulldownMenu {
controls {
XmPushButton {
arguments { XmNlabelString = "New"; };
callbacks { XmNactivateCallback =
procedure new_buffer(); };
};
XmPushButton {
arguments { XmNlabelString = "Open..."; };
callbacks { XmNactivateCallback =
procedure
GPcallback("open_file"); };
};
XmPushButton {
arguments { XmNlabelString = "Save"; };
callbacks { XmNactivateCallback =
procedure save_file(); };
};
XmPushButton {
arguments { XmNlabelString = "Save As..."; };
callbacks { XmNactivateCallback =
procedure
GPcallback("save_as"); };
};
XmSeparator {};
XmPushButton {
arguments { XmNlabelString = "Print"; };
};
XmSeparator {};
XmPushButton {
arguments { XmNlabelString = "Exit"; };
callbacks { XmNactivateCallback =
procedure exit_editor(); };
};
};
};
object optionmenu : XmCascadeButton {
arguments {
XmNlabelString = 'Options';
XmNmnemonic = 79; ! ASCII 'O'
};
controls {
XmPulldownMenu option_pulldown;
};
};
object option_pulldown : XmPulldownMenu {
controls {
XmPushButton {
arguments { XmNlabelString = "Change Directory"; };
callbacks { XmNactivateCallback =
procedure
GPcallback("cd_prompt"); };
};
XmSeparator {};
XmPushButton {
arguments { XmNlabelString = "Text Search"; };
callbacks { XmNactivateCallback =
procedure
GPcallback("search_prompt"); };
};
XmPushButton {
arguments { XmNlabelString = "Text Replace"; };
};
};
};
object helpmenu : XmCascadeButton {
arguments {
XmNlabelString = "Help";
XmNmnemonic = 72; ! ASCII 'H'
};
};
object workframe : XmFrame {
controls {
XmScrolledText textframe;
};
};
object textframe : XmScrolledText {
arguments {
XmNeditMode = XmMULTI_LINE_EDIT;
XmNscrollHorizontal = true;
XmNscrollVertical = true;
XmNrows = 20;
XmNcolumns = 60;
};
callbacks {
XmNcreateCallback = procedure create_text_widget();
};
};
object cd_prompt : XmPromptDialog {
arguments {
XmNdialogTitle = "change directory";
XmNselectionLabelString
= "Change to which directory?";
};
};
object search_prompt : XmPromptDialog {
arguments {
XmNdialogTitle = "text search";
XmNselectionLabelString
= "Enter search string:";
};
};
object open_file : XmFileSelectionDialog {
arguments {
XmNdialogTitle = "open file";
};
callbacks {
XmNokCallback = procedure load_file();
};
};
object save_as : XmPromptDialog {
arguments {
XmNdialogTitle = "save file";
XmNselectionLabelString
= "Save as what file?";
};
callbacks {
XmNokCallback = procedure saveas_file();
};
};
end module;